// import React from 'react';
import React, { Suspense, lazy } from 'react';


// import { BrowserRouter as Router, Route, Switch, Link } from 'react-router-dom';
import { HashRouter as Router, Route, Switch } from 'react-router-dom';

const OneView = lazy(() => import('@pages/portal/OneView'));
const TwoView = lazy(() => import('@pages/portal/TwoView'));

const TopHeader = lazy(() => import('@src/components/TopHeader'));

const AuthRoute = lazy(() => import('./AuthRoute.jsx'));

//loginMask 选直接到index.html写一下样式哈

const HomeRouter = () => (
    <Router>

        <Suspense fallback={<div className="loginMask">正在拼命加载...</div>}>
            <TopHeader />

            <Switch>
                <AuthRoute path="/One" component={OneView} />
                <AuthRoute path="/Two" component={TwoView} />
                <AuthRoute exact path="/" component={OneView} />

            </Switch>
        </Suspense>
    </Router>
);

export default HomeRouter;